<!--
 * @FilePath     : /study_code/jquery/api-offset.html
 * @Description  : jqObj.offset([obj]) 元素的偏移坐标
 * @Date         : 2025-04-21 09:18:17
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-21 09:19:28
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <!-- <link rel="stylesheet" href="" /> -->
    <style>
      .box1 {
        width: 200px;
        height: 200px;
        background-color: lightgreen;
      }
      .box2 {
        width: 200px;
        height: 200px;
        background-color: pink;
        /* padding: 11px; */
        /* border: 13px solid red; */
        margin: 24px;
        position: absolute;
        top: 200px;
        left: 10px;
      }
    </style>
  </head>
  <body>
    <div class="box1"></div>
    <div class="box2"></div>

    <script src="/jquery/dist/jquery.min.js"></script>
    <script>
      $(function () {
        console.log('偏移1', $('.box2').offset())
        // 200 + 24, 10 + 24;
      })
    </script>
  </body>
</html>
